package gameSprites; 
import javax.swing.*;

import java.awt.Point;
import java.awt.event.*;

import gameInterface.Characters;
import gameInventory.Inventory;
import gameMap.Map;
import gameUtils.Coordinate;


/**
 * @author Logical Solutions
 *
 */
public class PChar implements Characters{
	private Coordinate _position;
	private String[] _SpriteFramesArray;
	
	private static final ImageIcon[] imagesDown = {	new ImageIcon("src/spriteImages/down1.png"),
													new ImageIcon("src/spriteImages/down2.png"), 
													new ImageIcon("src/spriteImages/down3.png"), 
													new ImageIcon("src/spriteImages/down4.png")};
	private static final ImageIcon[] imagesLeft = {	new ImageIcon("src/spriteImages/left1.png"),
													new ImageIcon("src/spriteImages/left2.png"), 
													new ImageIcon("src/spriteImages/left3.png"), 
													new ImageIcon("src/spriteImages/left4.png")};
	private static final ImageIcon[] imagesRight = {new ImageIcon("src/spriteImages/right1.png"),
													new ImageIcon("src/spriteImages/right2.png"), 
													new ImageIcon("src/spriteImages/right3.png"), 
													new ImageIcon("src/spriteImages/right4.png")};
	private static final ImageIcon[] imagesUp = {	new ImageIcon("src/spriteImages/up1.png"),
													new ImageIcon("src/spriteImages/up2.png"), 
													new ImageIcon("src/spriteImages/up3.png"), 
													new ImageIcon("src/spriteImages/up4.png")};
		
	//Map map;
	//Inventory inv;
	JLayeredPane currentPane = new JLayeredPane();
		
	public PChar()
	{
		//currentPane = pCharLPane;
	}
		
	public ImageIcon getSpriteDown(int pos)
	{
		return imagesDown[pos];
	}

	public ImageIcon getSpriteUp(int pos)
	{
		return imagesUp[pos];
	}
	
	public ImageIcon getSpriteLeft(int pos)
	{
		return imagesLeft[pos];
	}
	
	public ImageIcon getSpriteRight(int pos)
	{
		return imagesRight[pos];
	}
	
	public Coordinate getCoordinate(){
		return _position;
	}
	
	public int getWidth(String dir, int pos){
		int width=0;
		if(dir == "left")
		{
			width = imagesLeft[pos].getIconWidth();
		}
		else if(dir == "right")
		{
			width = imagesRight[pos].getIconWidth();
		}
		else if(dir == "up")
		{
			width = imagesUp[pos].getIconWidth();
		}
		else if(dir == "down")
		{
			width = imagesDown[pos].getIconWidth();
		}
		return width;
	}
	
	public int getHeight(String dir, int pos){
		int height=0;
		if(dir == "left")
		{
			height = imagesLeft[pos].getIconHeight();
		}
		else if(dir == "right")
		{
			height = imagesRight[pos].getIconHeight();
		}
		else if(dir == "up")
		{
			height = imagesUp[pos].getIconHeight();
		}
		else if(dir == "down")
		{
			height = imagesDown[pos].getIconHeight();
		}
		return height;
	}
	
	public String[] getSpriteFrames(){
		return _SpriteFramesArray;
	}
}
